/**
 * ===========================================================================
 * 版权所有 湖南免了么网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.mianle.me
 * ===========================================================================
 * 10:23 2018/6/9
 */
package com.mianle.userapi.mapper;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: yiyuan
 * @Description:
 * @Date: Created in 10:23 2018/6/9
 *
 */
@Repository
public class SessionMapper extends SqlSessionDaoSupport {

    @Resource
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        super.setSqlSessionFactory(sqlSessionFactory);
    }

    @SuppressWarnings("unchecked")
    public Map<String,Object> selectMap(Object object){
        ResHandle handler = new ResHandle();
        this.getSqlSession().select(GaodeMapper.class.getName()+".select", object, handler);
        Map<String, Object> map = handler.getMappedResults();
        return map;
    }
}
